// implements the base class for the patterns
public class PLFeatureLine extends PLFeature {
	private static final long serialVersionUID = 1L;

	public PLFeatureLine() {
		super("Line");
	}
	
	public float BuildResponse(PLShape query, PLOutShape  outResponse) { 
		if (!query.IsValid()) {
			PLDebug.Warn("Invalid query %s response %s", query.GetShapeId());
			return 0;
		}
		
		PLAttrib  attrib = GetAttribByType(query.GetShapeId(), PLShape.ShapeIdT.kLine);
		if (null != attrib)
			return attrib.BuildResponse(query, outResponse);

		return 0;
	}	
	
	// the resulting float value reflects the confidence in response, 
	// if the response perfectly satisfies the pattern, 1 is returned, values less than 1 reflect 
	// decrease in confidence in the response.
	// if the confidence is too low, the pattern also returns a new shape that better fits the pattern.
	public float ValidateResponse(PLShape query, PLShape response, PLOutShape  outBetterMatch) {return 0f;}

	public float ImproveResponse(PLShape query, PLOutShape outResponse, PLShape  betterMatch) {return 0f;}
	

	public void UpdateAttributes(PLShape inQuery,PLShape inResponse) {		
		if (!inQuery.IsValid() || !inResponse.IsValid() || inResponse.GetShapeId() != PLShape.ShapeIdT.kLine) {
			PLDebug.Warn("Invalid query %s response %s", inQuery.GetShapeId(), inResponse.GetShapeId());
			return;
		}
		PLAttrib  attrib = GetAttribByType(inQuery.GetShapeId(), inResponse.GetShapeId());
		if (null != attrib)
			attrib.UpdateAttribs(inQuery, inResponse);
	}

}
